<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form:form action="${pageContext.request.contextPath }/update" method="post" modelAttribute="employee" >
		<c:if test="${!empty employee.id }" var="flag">
			<form:hidden path="id"/>
			<input type="hidden" name="_method" value="PUT">
		
		</c:if>
	
		name:<form:input path="name" />
		<br>
		email:<form:input path="email"/>
		<br>
		salary:<form:input path="salary" />
		<br>
		department:<form:select path="dept.id" items="${alldept }" itemLabel="departmentName" itemValue="id"></form:select>
		<br>
		<c:if test="${flag }">
			<input type="submit" value="修改">
		</c:if>
		<c:if test="${!flag }">
			<input type="submit" value="添加">
		</c:if>
	
	
	
	</form:form>

</body>
</html>